package org.wu.reggie.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.wu.reggie.entity.AddressBook;
import org.wu.reggie.mapper.AddressBookMapper;
import org.wu.reggie.service.AddressBookService;

import java.util.List;


@Service
public class AddressBookServiceImpl implements AddressBookService {


    @Autowired
    private AddressBookMapper addressBookMapper;

    @Override
    public List<AddressBook> queryAddressList(Long userId) {

        List<AddressBook> addressBookList = addressBookMapper.queryAddressList(userId);
        return addressBookList;
    }

    @Override
    public void save(AddressBook addressBook) {
        addressBookMapper.save(addressBook);
    }

    @Override
    public AddressBook getDefaultAddress(Long currentId) {
       return addressBookMapper.getDefaultAddress(currentId);

    }
}
